package com.zjhn.ds.boot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @BelongsProject: ds_jlw
 * @BelongsPackage: com.zjhn.ds.boot
 * @Author: sxt
 * @CreateTime: 2023-09-07  17:43
 * @Description: 开机redis缓存
 * @Version: 1.0
 */
@Slf4j
@Component
public class RedisStartBoot implements CommandLineRunner {

    @Resource
    private CacheHandler cacheHandler;

    @Override
    public void run(String... strings) {
        try {
            cacheHandler.cacheLoad();
        } catch (Exception e) {
            log.error("====[ERROR]========RedisStartBoot====run 缓存加载失败");
        }
    }

}
